<?php

declare(strict_types=1);

namespace DcrSwoole\Utils;

use DcrRedis\Redis;

/**
 * Class DataRedis
 * @package DcrSwoole\Utils
 * 封装 Redis类 方法
 * @method   bool isConnected()
 * @method   string|bool getHost()
 * @method   int|bool getPort()
 * @method   int|bool getDbNum()
 * @method   float|bool getTimeout()
 * @method   float|bool getReadTimeout()
 * @method   string|null|bool getPersistentID()
 * @method   string|null|bool getAuth()
 * @method   bool swapdb(int $db1, int $db2)
 * @method   mixed|null getOption($option)
 * @method   bool|string ping($message)
 * @method   string echo ($message)
 * @method   string|mixed|bool get($key)
 * @method   bool set($key, $value, $timeout = NULL)
 * @method   bool setex($key, $ttl, $value)
 * @method   bool psetex($key, $ttl, $value)
 * @method   bool setnx($key, $value)
 * @method   int del($key1, ...$otherKeys)
 * @method   int delete($key1, $key2 = NULL, $key3 = NULL)
 * @method   int unlink($key1, $key2 = NULL, $key3 = NULL)
 * @method   Redis multi($mode = 1)
 * @method   void|array exec()
 * @method   mixed discard()
 * @method   void watch($key)
 * @method   mixed unwatch()
 * @method   mixed|null subscribe($channels, $callback)
 * @method   mixed psubscribe($patterns, $callback)
 * @method   int publish($channel, $message)
 * @method   array|int pubsub($keyword, $argument)
 * @method   mixed unsubscribe($channels = NULL)
 * @method   mixed punsubscribe($patterns = NULL)
 * @method   int|bool exists($key)
 * @method   int incr($key)
 * @method   float incrByFloat($key, $increment)
 * @method   int incrBy($key, $value)
 * @method   int decr($key)
 * @method   int decrBy($key, $value)
 * @method   int|bool lPush($key, ...$value1)
 * @method   int|bool rPush($key, ...$value1)
 * @method   int|bool lPushx($key, $value)
 * @method   int|bool rPushx($key, $value)
 * @method   mixed|bool lPop($key)
 * @method   mixed|bool rPop($key)
 * @method   array blPop($keys, $timeout)
 * @method   array brPop(array $keys, $timeout)
 * @method   int|bool lLen($key)
 * @method   int lSize($key)
 * @method   mixed|bool lIndex($key, $index)
 * @method   mixed|bool lGet($key, $index)
 * @method   bool lSet($key, $index, $value)
 * @method   array lRange($key, $start, $end)
 * @method   array lGetRange($key, $start, $end)
 * @method   array|bool lTrim($key, $start, $stop)
 * @method   mixed listTrim($key, $start, $stop)
 * @method   int|bool lRem($key, $value, $count)
 * @method   mixed lRemove($key, $value, $count)
 * @method   int lInsert($key, $position, $pivot, $value)
 * @method   int|bool sAdd($key, ...$value1)
 * @method   int sRem($key, ...$member1)
 * @method   mixed sRemove($key, ...$member1)
 * @method   bool sMove($srcKey, $dstKey, $member)
 * @method   bool sIsMember($key, $value)
 * @method   mixed sContains($key, $value)
 * @method   int sCard($key)
 * @method   string|mixed|array|bool sPop($key, $count = 1)
 * @method   string|mixed|array|bool sRandMember($key, $count = 1)
 * @method   array sInter($key1, ...$otherKeys)
 * @method   int|bool sInterStore($dstKey, $key1, ...$otherKeys)
 * @method   array sUnion($key1, ...$otherKeys)
 * @method   int sUnionStore($dstKey, $key1, ...$otherKeys)
 * @method   array sDiff($key1, ...$otherKeys)
 * @method   int|bool sDiffStore($dstKey, $key1, ...$otherKeys)
 * @method   array sMembers($key)
 * @method   array sGetMembers($key)
 * @method   array|bool sScan($key, &$iterator, $pattern = NULL, $count = 0)
 * @method   string|mixed getSet($key, $value)
 * @method   string randomKey()
 * @method   bool select($dbIndex)
 * @method   bool move($key, $dbIndex)
 * @method   bool rename($srcKey, $dstKey)
 * @method   mixed renameKey($srcKey, $dstKey)
 * @method   bool renameNx($srcKey, $dstKey)
 * @method   bool expire($key, $ttl)
 * @method   bool pExpire($key, $ttl)
 * @method   bool setTimeout($key, $ttl)
 * @method   bool expireAt($key, $timestamp)
 * @method   bool pExpireAt($key, $timestamp)
 * @method   array keys($pattern)
 * @method   mixed getKeys($pattern)
 * @method   int dbSize()
 * @method   bool auth($password)
 * @method   bool bgrewriteaof()
 * @method   bool slaveof($host = '127.0.0.1', $port = 6379)
 * @method   mixed slowLog(string $operation, ?int $length = NULL)
 * @method   string|int|bool object($string = '', $key = '')
 * @method   bool save()
 * @method   bool bgsave()
 * @method   int lastSave()
 * @method   int wait($numSlaves, $timeout)
 * @method   int type($key)
 * @method   int append($key, $value)
 * @method   string getRange($key, $start, $end)
 * @method   mixed substr($key, $start, $end)
 * @method   int setRange($key, $offset, $value)
 * @method   int strlen($key)
 * @method   int bitpos($key, $bit, $start = 0, $end = NULL)
 * @method   int getBit($key, $offset)
 * @method   int setBit($key, $offset, $value)
 * @method   int bitCount($key)
 * @method   int bitOp($operation, $retKey, $key1, ...$otherKeys)
 * @method   bool flushDB()
 * @method   bool flushAll()
 * @method   array sort($key, $option = NULL)
 * @method   string info($option = NULL)
 * @method   bool resetStat()
 * @method   int|bool ttl($key)
 * @method   int|bool pttl($key)
 * @method   bool persist($key)
 * @method   bool mset(array $array)
 * @method   array getMultiple(array $keys)
 * @method   array mget(array $array)
 * @method   int msetnx(array $array)
 * @method   string|mixed|bool rpoplpush($srcKey, $dstKey)
 * @method   string|mixed|bool brpoplpush($srcKey, $dstKey, $timeout)
 * @method   int zAdd($key, $options, $score1, $value1, $score2 = NULL, $value2 = NULL, $scoreN = NULL, $valueN = NULL)
 * @method   array zRange($key, $start, $end, $withscores = NULL)
 * @method   int zRem($key, $member1, ...$otherMembers)
 * @method   int zDelete($key, $member1, ...$otherMembers)
 * @method   array zRevRange($key, $start, $end, $withscore = NULL)
 * @method   array zRangeByScore($key, $start, $end, array $options = array())
 * @method   array zRevRangeByScore($key, $start, $end, array $options = array())
 * @method   array|bool zRangeByLex($key, $min, $max, $offset = NULL, $limit = NULL)
 * @method   array zRevRangeByLex($key, $min, $max, $offset = NULL, $limit = NULL)
 * @method   int zCount($key, $start, $end)
 * @method   int zRemRangeByScore($key, $start, $end)
 * @method   mixed zDeleteRangeByScore($key, $start, $end)
 * @method   int zRemRangeByRank($key, $start, $end)
 * @method   mixed zDeleteRangeByRank($key, $start, $end)
 * @method   int zCard($key)
 * @method   int zSize($key)
 * @method   float|bool zScore($key, $member)
 * @method   int|bool zRank($key, $member)
 * @method   int|bool zRevRank($key, $member)
 * @method   float zIncrBy($key, $value, $member)
 * @method   int zUnionStore($output, $zSetKeys, ?array $weights = NULL, $aggregateFunction = 'SUM')
 * @method   mixed zUnion($Output, $ZSetKeys, ?array $Weights = NULL, $aggregateFunction = 'SUM')
 * @method   int zInterStore($output, $zSetKeys, ?array $weights = NULL, $aggregateFunction = 'SUM')
 * @method   mixed zInter($Output, $ZSetKeys, ?array $Weights = NULL, $aggregateFunction = 'SUM')
 * @method   array|bool zScan($key, &$iterator, $pattern = NULL, $count = 0)
 * @method   array bzPopMax($key1, $key2, $timeout)
 * @method   array bzPopMin($key1, $key2, $timeout)
 * @method   array zPopMax($key, $count = 1)
 * @method   array zPopMin($key, $count = 1)
 * @method   int|bool hSet($key, $hashKey, $value)
 * @method   bool hSetNx($key, $hashKey, $value)
 * @method   string hGet($key, $hashKey)
 * @method   int|bool hLen($key)
 * @method   int|bool hDel($key, $hashKey1, ...$otherHashKeys)
 * @method   array hKeys($key)
 * @method   array hVals($key)
 * @method   array hGetAll($key)
 * @method   bool hExists($key, $hashKey)
 * @method   int hIncrBy($key, $hashKey, $value)
 * @method   float hIncrByFloat($key, $field, $increment)
 * @method   bool hMSet($key, $hashKeys)
 * @method   array hMGet($key, $hashKeys)
 * @method   array hScan($key, &$iterator, $pattern = NULL, $count = 0)
 * @method   int hStrLen(string $key, string $field)
 * @method   int geoadd($key, $longitude, $latitude, $member)
 * @method   array geohash($key, ...$member)
 * @method   array geopos(string $key, string $member)
 * @method   float geodist($key, $member1, $member2, $unit = NULL)
 * @method   mixed georadius($key, $longitude, $latitude, $radius, $unit, ?array $options = NULL)
 * @method   array georadiusbymember($key, $member, $radius, $units, ?array $options = NULL)
 * @method   array config($operation, $key, $value)
 * @method   mixed eval($script, $args = array(), $numKeys = 0)
 * @method   mixed evaluate($script, $args = array(), $numKeys = 0)
 * @method   mixed evalSha($scriptSha, $args = array(), $numKeys = 0)
 * @method   mixed evaluateSha($scriptSha, $args = array(), $numKeys = 0)
 * @method   mixed script($command, $script)
 * @method   string|null getLastError()
 * @method   bool clearLastError()
 * @method   mixed client($command, $value = '')
 * @method   string _prefix($value)
 * @method   mixed _unserialize($value)
 * @method   mixed _serialize($value)
 * @method   string|bool dump($key)
 * @method   bool restore($key, $ttl, $value)
 * @method   bool migrate($host, $port, $key, $db, $timeout, $copy = false, $replace = false)
 * @method   array time()
 * @method   array|bool scan(&$iterator, $pattern = NULL, $count = 0)
 * @method   bool pfAdd($key, array $elements)
 * @method   int pfCount($key)
 * @method   bool pfMerge($destKey, array $sourceKeys)
 * @method   mixed rawCommand($command, $arguments)
 * @method   int getMode()
 * @method   int xAck($stream, $group, $messages)
 * @method   string xAdd($key, $id, $messages, $maxLen = 0, $isApproximate = false)
 * @method   array xClaim($key, $group, $consumer, $minIdleTime, $ids, $options = array())
 * @method   int xDel($key, $ids)
 * @method   mixed xGroup($operation, $key, $group, $msgId = '', $mkStream = false)
 * @method   mixed xInfo($operation, $stream, $group)
 * @method   int xLen($stream)
 * @method   array xPending($stream, $group, $start = NULL, $end = NULL, $count = NULL, $consumer = NULL)
 * @method   array xRange($stream, $start, $end, $count = NULL)
 * @method   array xRead($streams, $count = NULL, $block = NULL)
 * @method   array xReadGroup($group, $consumer, $streams, $count = NULL, $block = NULL)
 * @method   array xRevRange($stream, $end, $start, $count = NULL)
 * @method   int xTrim($stream, $maxLen, $isApproximate)
 * @method   int|bool sAddArray($key, array $values)
 */

class DataRedis
{
    public function __call($name, $args)
    {
        return Redis::$name(...$args);
    }
}
